package cn.springcloud.fix.demo.leecode;

public class Test {

    /**
     * @param salary 工资
     * @param fund   公积金
     *               security  社保
     *               <p>
     *               otherMoney 专项扣除
     *               几个月的工资
     */
    public static float getMouthMoney(float salary, float fund, float security, float otherMoney, int mouth) {
        float money = (salary - fund - security - otherMoney - 5000) * mouth;
        float jumpMoney = 0;
        float mouthMoney = 0;
        if (money > 0 && money <= 36000) {
            jumpMoney = money * 3 / 100;
        } else if (money > 36000 && money <= 144000) {
            jumpMoney = money * 10 / 100 - 2520;
        } else if (money > 144000 && money <= 300000) {
            jumpMoney = money * 20 / 100 - 16920;
        } else if (money > 300000 && money <= 420000) {
            jumpMoney = money * 25 / 100 - 31920;
        } else if (money > 420000 && money <= 660000) {
            jumpMoney = money * 30 / 100 - 52590;
        } else if (money > 660000 && money <= 960000) {
            jumpMoney = money * 35 / 100 - 85920;
        } else if (money > 960000) {
            jumpMoney = money * 45 / 100 - 181920;
        }
        mouthMoney = salary - fund - security - jumpMoney;

        return mouthMoney;
    }

    public static void main(String[] args) {
        for (int i = 1; i <= 12; i++) {
            float money = getMouthMoney(25100, 1483, 2224, 1500, i);
            System.out.println(money);
        }
    }
}
